/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package carshow;
import javax.swing.JFrame;
import javax.swing.JSeparator;
import javax.swing.JTable;
import javax.swing.JTextField;
import javax.swing.text.JTextComponent;

/**
 * A Frame object to encapsulate the printed version of the Awards Report
 * in an improved/controllable format.
 * @author Wayne
 */
public final class AwardPrintForm extends JFrame {
    private JTable table;
    String[] awards;
    AwardPrintForm(JTable table) {
        this(table,new String[0]); // init JFrame w/o Special Awards list
    }
    AwardPrintForm(JTable table, String[] awards) {
        this.awards = awards;
        this.table = table;
        refresh();
    }
    public void addTable(JTable table) {
        this.table = table;
    }
    
    public void addSpecials(String[] awards ){
        this.awards = awards;
    }
    
    public void refresh() {
        this.removeAll();
        this.add(this.table);
        this.add(new JSeparator());
        for(int i = 0; i < this.awards.length; i++) {
            JTextField jtc = new JTextField(awards[i]);
            this.add(jtc);
            if(i < this.awards.length-1) this.add(new JSeparator());
        }
    }
}
